﻿<phone:PhoneApplicationPage 
    x:Class="PhoneInfo.Page.userManager"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="800" d:DesignWidth="480"
    shell:SystemTray.IsVisible="false" Style="{StaticResource TransitionPageStyle}"
    xmlns:delay="clr-namespace:Delay;assembly=PhonePerformance" toolkit:TiltEffect.IsTiltEnabled="True" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"    
    >
	<phone:PhoneApplicationPage.Resources>
		<Style x:Key="ButtonStyle1" TargetType="Button">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
			<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
			<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
			<Setter Property="Padding" Value="10,3,10,5"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="0">
								<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</phone:PhoneApplicationPage.Resources>
   
    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="{Binding Source={StaticResource Theme}, Path=cuTheme.TextBrush}">
        
        <Grid.RowDefinitions>
            <RowDefinition Height="10"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ProgressBar  Grid.Row="0" Foreground="Orange" x:Name="ProgBar" Visibility="Collapsed"  IsIndeterminate="True" Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0" Grid.ColumnSpan="2"  Width="480" />
        <!--TitlePanel 包含应用程序的名称和页标题-->
        <StackPanel x:Name="TitlePanel" Grid.Row="1" Margin="12,17,0,28">
            <TextBlock x:Name="PageTitle" Text="账号管理" Margin="9,-7,0,0"   Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.TitleBrush}"  FontSize="40"/>
        </StackPanel>
        <Grid x:Name="ContentPanel" Grid.Row="2"  Margin="12,0,12,0">
            <ListBox  x:Name="accountManager" ItemsSource="{Binding}" Tap="accountManager_Tap">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <delay:FoodTemplateSelector x:Name="foodTemplateSelector" Content="{Binding}" RenderTransformOrigin="0.5,0.5">
                            <delay:FoodTemplateSelector.RenderTransform>
                                <CompositeTransform/>
                            </delay:FoodTemplateSelector.RenderTransform>
                            <delay:FoodTemplateSelector.Head>
                                <DataTemplate >
                                    <StackPanel Orientation="Horizontal">
                                        <StackPanel Width="380" Orientation="Horizontal">
                                            <toolkit:ContextMenuService.ContextMenu>
                                                <toolkit:ContextMenu>
                                                    <toolkit:MenuItem Header="删除"  Click="DeleteAccount"/>
                                                </toolkit:ContextMenu>
                                            </toolkit:ContextMenuService.ContextMenu>
                                            <Ellipse Width="24" Height="24" Margin="15,0,15,0" Stroke="Black" StrokeThickness="1">
                                                <Ellipse.Fill>
                                                    <SolidColorBrush Color="Blue"/>
                                                </Ellipse.Fill>
                                            </Ellipse>
                                            <TextBlock Text="{Binding Nick}" TextWrapping="Wrap"  Foreground="#0a98cd"
										 Margin="10,0,0,0" FontSize="24" d:LayoutOverrides="HorizontalAlignment" 
										 Height="45" VerticalAlignment="Bottom"/>
                                            <TextBlock Text="（" TextWrapping="Wrap"  Foreground="#535353" FontSize="24"
										 Margin="10,0,0,0" d:LayoutOverrides="HorizontalAlignment" 
										 Height="45" VerticalAlignment="Bottom"/>
                                            <TextBlock Text="{Binding Userid}" TextWrapping="Wrap" FontSize="24"
										 Margin="10,0,0,0"  d:LayoutOverrides="HorizontalAlignment"  Foreground="#535353"
										 Height="45" VerticalAlignment="Bottom"/>
                                            <TextBlock Text="）" TextWrapping="Wrap"  FontSize="24"  Foreground="#535353"
										 Margin="10,0,0,0"   d:LayoutOverrides="HorizontalAlignment" 
										 Height="45" VerticalAlignment="Bottom"/>

                                        </StackPanel>
                                        <Button Content="注销" Width="70" Height="50" Click="Button_Click" Style="{StaticResource ButtonStyle1}" BorderThickness="0"/>
                                    </StackPanel>
                                </DataTemplate>
                            </delay:FoodTemplateSelector.Head>
                            <delay:FoodTemplateSelector.Main>
                                <DataTemplate>
                                    <StackPanel Margin="10" Width="480">
                                        <toolkit:ContextMenuService.ContextMenu>
                                            <toolkit:ContextMenu>
                                                <toolkit:MenuItem Header="删除"  Click="DeleteAccount"/>
                                            </toolkit:ContextMenu>
                                        </toolkit:ContextMenuService.ContextMenu>
                                        <TextBlock   Text="{Binding UserName}" TextWrapping="Wrap"  Margin="0" Style="{StaticResource PhoneTextSubtleStyle}" FontSize="30"/>                                     
                                    </StackPanel>
                                </DataTemplate>
                            </delay:FoodTemplateSelector.Main>
                            <delay:FoodTemplateSelector.Tail>
                                <DataTemplate>
                                    <StackPanel >
                                        <TextBlock  TextWrapping="Wrap"  Text="{Binding UserName}" Margin="0" 
                                                    Foreground="{Binding Source={StaticResource Theme}, Path=cuTheme.SecondTextBrush}" FontSize="30"/>                          
                                    </StackPanel>
                                </DataTemplate>
                            </delay:FoodTemplateSelector.Tail>
                        </delay:FoodTemplateSelector>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>
 
    <!--演示 ApplicationBar 用法的示例代码-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="按钮 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="按钮 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="菜单项 1"/>
                <shell:ApplicationBarMenuItem Text="菜单项 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>
